package net.ifilm.entity;

public class PageCount {

    /**
     * 当前是第几页
     */
    private int currentPage;

    /**
     * 总页面数
     */
    private int totalPage;

    /**
     * 总记录数
     */
    private int totalNum;

    /**
     * 设置每页显示记录数
     */
    private int countPerPage = 15;

    /**
     * mysql查询开始记录处
     */
    private int startRecord;

    // ---------------------------------------------------------- addition property

    private User user;

    /**
     * 搜索关键字
     */
    private String searchKey;

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    private String level;

    /**
     * 排序的列名
     */
    private String sortColumn;

    public String getSortColumnSecond() {
        return sortColumnSecond;
    }

    public void setSortColumnSecond(String sortColumnSecond) {
        this.sortColumnSecond = sortColumnSecond;
    }

    private String sortColumnSecond;

    private String filmTypeId;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    private String type;

    private String regionId;

    public int getFilmId() {
        return filmId;
    }

    public void setFilmId(int filmId) {
        this.filmId = filmId;
    }

    private int filmId;

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    private String tag;

    public String getStarId() {
        return starId;
    }

    public void setStarId(String starId) {
        this.starId = starId;
    }

    private String starId;

    public String getShowTime() {
        return showTime;
    }

    public void setShowTime(String showTime) {
        this.showTime = showTime;
    }

    private String showTime;

    // ---------------------------------------------------------- seeter/getter

    public int getCountPerPage() {
        return countPerPage;
    }

    public void setCountPerPage(int countPerPage) {
        this.countPerPage = countPerPage;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(int totalNum) {
        this.totalNum = totalNum;
    }

    public int getTotalPage() {
        if (totalNum % countPerPage == 0)
            return totalNum / countPerPage;
        else
            return totalNum / countPerPage + 1;
    }

    public int getStartRecord() {
        return (currentPage - 1) * countPerPage;
    }

    public String getSearchKey() {
        return searchKey;
    }

    public void setSearchKey(String searchKey) {
        this.searchKey = searchKey;
    }

    public void setStartRecord(int startRecord) {
        this.startRecord = startRecord;
    }

    public String getSortColumn() {
        return sortColumn;
    }

    public void setSortColumn(String sortColumn) {
        this.sortColumn = sortColumn;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String getFilmTypeId() {
        return filmTypeId;
    }

    public void setFilmTypeId(String filmTypeId) {
        this.filmTypeId = filmTypeId;
    }

    public String getRegionId() {
        return regionId;
    }

    public void setRegionId(String regionId) {
        this.regionId = regionId;
    }
} ///:~
